<html>
    <head><title>Content Manager</title>
        <script type="text/javascript">  
            function expand(id) {
                var el=document.getElementById(id);
                if (el.style.display!="none"){
                    el.style.display="none";
                }else{
                    el.style.display="block";
                }
            }
        </script>  

    </head>
    <body bgcolor="white">
        <%@include file="tpl_header.jsp"%>
        <table width="100%" border="0">
            <tr>
                <td width="65%">  
                    <%@include file="QuestionMess.jsp"%>
                    <table width="100%" border="0">
                        <tr>
                            <td><a href="#" onClick="expand('questiontemplate');"><img src="imgs/expand.jpg" alt="Expand"></a>Your Question Template:</td>
                        </tr>
                    </table>
                    <table width="100%" border="0">
                        <tr>
                            <td>
                                <div id="questiontemplate" style="display:block">  
                                    <form action="" method=post>
                                        <textarea name=question rows="5" cols="80" ><%=nonull(n.getQuestion0())%></textarea><p>
                                            <input name="submit" type=submit value="Auto Substitute">
                                    </form>
                                </div></td>
                        </tr>
                    </table>
                    <table width="100%" border="0">
                        <tr>
                            <td><a href="#" onClick="expand('Substitutionlist');"><img src="imgs/expand.jpg" alt="Expand"></a>List of Substitutions: 
                            </td> 
                        </tr>
                        <tr>
                            <td> <div id="Substitutionlist" style="display:block">  
                                   
                                    <% ArrayList<String> phs = n.getPhsNamList();
                                    String[] typnamlist = new String[4];%>
                                    <% for (var_count = 0; var_count < phs.size(); var_count++) {                                        
                                       typnamlist = n.getTypNamList().get(var_count); %>       
                                        <%=phs.get(var_count) %> ===>[<%=typnamlist[0] %>][<%=typnamlist[1] %>][<%=typnamlist[2] %>][<%=typnamlist[3] %>] <p>
                                        <%  }%>  
                                         <form name="Substitutionform" action="" method=post>
                                        <input type=text name=phs size="10" maxlength="20" value="e.g. box" onFocus="if(this.value.toString().substr(0,4)=='e.g.')this.value='';"> 
                                         <input type=text name=phses size="10" maxlength="20" value="e.g. boxes" onFocus="if(this.value.toString().substr(0,4)=='e.g.')this.value='';">                                         <select  name="type1" >
                                            <option value="0">-Main Type-</option>
                                            <% for (int i = 0; i < rs.length && rs[i] != null; i++) {%>
                                            <option ><%=rs[i]%></option>
                                            <% }%>
                                        </select>
                                                                     <select  name="type2" >
                                            <option value="0">-Sub Type 1-</option>
                                            <% for (int i = 0; i < rsub.length && rsub[i] != null; i++) {%>
                                            <option  ><%=rsub[i]%></option>
                                            <% }%>
                                        </select>                                        
                            <a href="PhsTypeMan.jsp" title="Variable Type Manager" target="_self">Phrase Type Manager</a>
                                        <input name="submit" type=submit value="Add to Dictionary">  <p>
                                    </form>
                                        <p>
                                              <%// for (var_count = 0; var_count < 10; var_count++) {%>       
                                    <%//=db.getRandomName(2,3) %> <p>
                                        <%//  }%>  
                                </div></td>
                        </tr>
                    </table>
                </td>
<%@include file="QuestionPreview.jsp" %>
            </tr>
        </table>
        <table>
            <tr>            
                <%if (!n.getHint().equals("no hint")) {%>
            <font color="red"><%=n.getHint()%></font><br>
            <%}%>
            </tr>
            </table>
 
            <div id="DBquestionlist" style="display:block"> 
                <%@include file="QuestionList.jsp"%> 
            </div>  


            <%@include file="tpl_footer.jsp"%>
    </body>
</html>